#pragma once

#include "mut.h"

class CMUTCamera{
public:
	D3DXVECTOR3 pos;
	D3DXVECTOR3 look;
	D3DXVECTOR3 up;
	D3DXVECTOR3 right;
	D3DXMATRIX matView;
	float lookAtPosBias;
	bool bLockedUp;

	CMUTCamera() : pos( 0, 0, 0 ), look( 0, 0, 1 ), up( 0, 1, 0 ), right( 1, 0, 0 ), bLockedUp(true), lookAtPosBias(0) {}
	D3DXMATRIX& GetMatrix();
	void RotateUp( float rad );
	void RotateRight( float rad );
	void Normalize(){
		D3DXVec3Normalize( &look, &look );
		D3DXVec3Normalize( &up, &up );
		D3DXVec3Normalize( &right, &right );
	}
	void MoveLook( float dis ){
		D3DXVECTOR3 walk = look;
		walk.y = 0;
		D3DXVec3Normalize( &walk, &walk );
		pos += dis * walk;
	}
	void MoveRight( float dis ){
		pos += dis * right;
	}
	void MoveUp( float dis ){
		pos += dis * up;
	}
};